<template>
	<view class="page">
		<view class="cell flex" @tap="to('sysMessage')">
			<view class="cell-head">
				<image src="/static/images/pay/mess1.png" class="avatar"></image>
				<u-badge type="error" :count="userinfo.notice"></u-badge>
			</view>
			<view class="flex-1">系统公告</view>
			<image src="/static/images/pay/arrow-right.png" class="arrow"></image>
		</view>
		<view class="cell flex" @tap="to('otherMessage')">
			<view class="cell-head">
				<image src="/static/images/pay/mess2.png" class="avatar"></image>
				<u-badge type="error" :count="userinfo.newsNum"></u-badge>
			</view>
			<view class="flex-1">消息通知</view>
			<image src="/static/images/pay/arrow-right.png" class="arrow"></image>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userinfo:{},
				count2:1
			};
		},
		onShow() {
			const token=uni.getStorageSync('token')
			if(token){
				this.getuserinfo.getuserinfo(uni.getStorageSync('userdata').id).then((res)=>{
					
					if(res){
						this.userinfo=res.data
					}
				})
			}
		},
		methods:{
			to(url){
				uni.navigateTo({
					url:'/pages/message/'+url
				})
			}
		}
	}
</script>

<style lang="less" scoped>
	

.flex{
	display: flex;
	&-1{
		flex: 1;
	}
	&-between{
		justify-content: space-between;
	}
}
.cell{
	padding: 20rpx 30rpx;
	align-items: center;
	.avatar{
		margin-top: 30rpx;
		width: 84rpx;
		height: 84rpx;
		border-radius: 84px;
	}
	.arrow{
		width: 14rpx;
		height: 24rpx;
	}
}
.cell-head{
	width: 120rpx;
	height: 130rpx;
	margin-right: 20rpx;
	position: relative;
}
</style>
